package com.zhouyilin.bigevent2.anno;

import com.zhouyilin.bigevent2.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Constraint(
        validatedBy = {StateValidation.class}//指定提供校验规则的类
)
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)

public @interface State {
//  提供校验失败后的提示信息
    String message() default "{State的值只能是：“已发布”或“草稿”}";
//  指定分组
    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};


}
